package com.vc.aha_server_event.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.vc.aha_server_event.dto.TravelThroughPageDataDTO;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.bson.types.ObjectId;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.IndexDirection;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * @author Vc
 * @date 2022/03/30 15:04
 */
@Document(collection = "travel_page")
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class TravelThroughPage {
    @Id
    @JsonIgnore
    private ObjectId id;

    /**
     * 事件id
     */
    @Indexed
    private Integer eventId;

    /**
     * 插入时间
     */
    private Date time;

    /**
     * 用户ID
     */
    @Indexed
    Integer userId;
    /**
     * 当前页面Schema
     */
    @Indexed
    String pageSchema;
    /**
     * 停留秒数
     */
    @Indexed
    Integer timeCount;
    /**
     * 来源页面Schema
     */
    @Indexed
    String sourcePageSchema;
    /**
     * 进入当前页面时间
     */
    @Indexed(direction = IndexDirection.DESCENDING)
    Date accessTime;
    /**
     * 离开当前页面时间
     */
    Date leaveTime;
    /**
     * 其他信息
     */
    String otherInfo;
}
